import ReactDOM from 'react-dom/client'
import App from './App'
import './index.css'
import './rem'
import { BrowserRouter as Router } from 'react-router-dom'
import axios from 'axios'

// 请求拦截器
axios.interceptors.request.use(
  ( config ) => {
    document.body.classList.add('loading-indicator');
    
    return config
  },
  ( error ) => {
    return Promise.reject(error);
  }
)

// 相应拦截器
axios.interceptors.response.use(
  ( response ) => {

    document.body.classList.remove('loading-indicator');


    
    return response;
  },
  ( error ) => {
    return Promise.reject(error);
  }
)


ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
  // <React.StrictMode>
    <Router>
      <App />
    </Router>
  // </React.StrictMode>
)
